<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>箭头构建器测试</title>
    <script src="https://cdn.babylonjs.com/babylon.js"></script>
    <script src="https://cdn.babylonjs.com/gui/babylon.gui.min.js"></script>
</head>
<body style="margin: 0; overflow: hidden;">
    <canvas id="renderCanvas" style="width: 100%; height: 100%; touch-action: none;"></canvas>
    <script>
        // 创建箭头构建器类
        class ArrowBuilder {
        }

        // 创建场景和UI
        const canvas = document.getElementById('renderCanvas');
        const engine = new BABYLON.Engine(canvas, true);
        
        const createScene = function() {
            const scene = new BABYLON.Scene(engine);
            scene.clearColor = new BABYLON.Color4(0, 0, 0, 0); // 透明背景
            
            // 创建相机
            const camera = new BABYLON.ArcRotateCamera("camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
            camera.setPosition(new BABYLON.Vector3(0, 0, -10));
            camera.attachControl(canvas, true);
            
            // 创建UI
            const advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");
            const container = new BABYLON.GUI.Container();
            const rect = new BABYLON.GUI.Rectangle();
            rect.color = 'red';
            rect.thinkness = 1;
            rect.width = 100;
            rect.height = 100;
            container.addControl(rect);
            advancedTexture.addControl(container);
            
            return scene;
        };
        
        const scene = createScene();
        
        engine.runRenderLoop(function() {
            scene.render();
        });
        
        window.addEventListener('resize', function() {
            engine.resize();
        });
    </script>
</body>
</html>